<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>我的证照</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="../../../css/mui.min.css">
		<link rel="stylesheet" href="../../../css/app.css">
		<style>
			.mui-bar-nav~.mui-content{padding:0;margin-top:45px;background:#fff;position:absolute;left:0;height:100%;overflow:auto;}
			/*头部上传说明*/
			.content_top{width:7.05rem;overflow:hidden;margin:.25rem auto;background:#f3f3f3 url(../../../images/license/info_bg.png) no-repeat;background-size:100% auto;background-position:left bottom;padding:.5rem .35rem .85rem .35rem;box-sizing:border-box;border-radius:.1rem;}
			.content_top>p{font-size:.3rem;color:#666;line-height:.45rem;margin:0 0 .15rem 0;}
			.content_top>.top_info{background:#fe9e2b;color:#fff;font-size:.28rem;padding:.2rem;box-sizing:border-box;border-radius:.08rem;}
			/*材料列表*/
	        .basic_info{width:100%;float:left;padding:.15rem 0 0;margin:0;}
		    .basic_info>li{width:7.28rem;line-height:.9rem;border-bottom:1px solid #e5e5e5;float:right;}
		    .basic_info>li>label,.basic_info>li>a>label{width:1.8rem;float:left;text-align:right;font-size:.3rem;color:#333;box-sizing:border-box;padding-left:.25rem;}
		    .basic_info>li>span,.basic_info>li>a>span{font-size:.3rem;color:#9d9d9d;width:5.3rem;float:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
			.form_control{width:7.07rem;float:left;padding:0 .4rem;box-sizing:border-box;line-height:.9rem;color:#9d9d9d;font-size:.3rem;border:none;height:.9rem;margin:0;}
			.license_list{display:block;width:7.5rem;float:right;background:#fff;border-bottom:1px solid #e5e5e5;}
			.list_title{width:4.75rem;float:left;font-size:.3rem;line-height:.5rem;margin-top:.42rem;color:#333;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}
			.gray_info{width:4.75rem;float:left;font-size:.28rem;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:#999;margin-bottom:.42rem;line-height:.35rem;}
			.license_list .img_cont{width:.84rem;height:.86rem;float:left;border-radius:.06rem;margin-right:.15rem;text-align:center;margin-top:.46rem;margin-left:.25rem;}
			.license_list .img_cont>img{width:.5rem;margin-top:.18rem;}
			.license_list .bg_blue{background:#0cb9f7;}
			.license_list .bg_blue01{background:#0c8bf7;}
			.license_list .bg_orange{background:#ff9d3e;}
			.license_list .bg_green{background:#12c897;}
			.license_list .bg_red{background:#fc4e4e;}
			.license_list .delete{float:right;color:#666666;margin:-.45rem .3rem 0 0;}
			.license_list .delete .mui-icon-download{font-size:.38rem;}
		  	.mui-btn-primary{margin-top:.18rem;}
		</style>
	</head>
	<body>
		<div class="mui-content" style="background:#fff;">
			<!--头部上传说明-->
			<div class="content_top">
				<p>材料信息（说明：您所上传的材料可信等级默认为D级 ）</p>
				<div class="top_info">注：D级为用户自制材料，由用户承诺对其真实性负责，可在申请政务服务事项时直接使用。</div>
			</div>
			<!--材料列表-->
			<ul class="basic_info">
			 	<li>
			 		<label>材料名称：</label>
			 		<span id="clmc"></span>
			 	</li>
			 	<li>
			 		<label>上传时间：</label>
			 		<span id="scsj"></span>
			 	</li>
			 	<li>
			 		<label>备注：</label>
			 		<span id="bz"></span>
			 	</li>
		    </ul>
		    <div id="clList">
		    </div>
		</div>
	</body>
	<script src="../../../js/mui.min.js"></script>
	<script src="../../../js/common.js"></script>
	<script type="text/javascript" src="../../../js/file.js" ></script>
	<script>
		var downPath = "";
	    mui.plusReady(function() {
			var oid = utils.getUrlParam("oid");
			loadData(oid);
		});
	    
	    /**
		 * 加载数据
		 * @param {Object} oid 主键
		 */
		function loadData(oid){
			var param = 'oid=' + oid;
			var url = 'appHttpService/appNetUserLicenseView.do';
			utils.ajax(url, function(data) {
				data = JSON.parse(data);
				if(data.code == 0) {
					var netUserLicense = JSON.parse(data.netUserLicense);
					document.getElementById("clmc").innerHTML = netUserLicense.licenseName;
					document.getElementById("scsj").innerHTML = utils.format(netUserLicense.uploadDate,'yyyy-MM-dd');
					document.getElementById("bz").innerHTML = netUserLicense.memo;
					downPath = data.downPath;
					
					if(data.licenseAttaList != undefined && data.licenseAttaList != null){
						var licenseAttaList = JSON.parse(data.licenseAttaList);
						var slide_div_html = "";
						for(var i in licenseAttaList){
							var src = '';
							if(licenseAttaList[i].extensionName == 'doc' || licenseAttaList[i].extensionName == 'docx'){
								src = "../../../images/license/word.png";
							}
							if(licenseAttaList[i].extensionName == 'gif' || licenseAttaList[i].extensionName == 'png'|| licenseAttaList[i].extensionName == 'jpg' || licenseAttaList[i].extensionName == 'jpeg'){
								src = "../../../images/license/img.png";
							}
							if(licenseAttaList[i].extensionName == 'xlsx' || licenseAttaList[i].extensionName == 'xlsx'){
								src = "../../../images/license/excel.png";
							}
							if(licenseAttaList[i].extensionName == 'pdf'){
								src = "../../../images/license/pdf.png";
							}
							slide_div_html += "<div class='license_list'><span class='img_cont bg_blue'><img src="+src+"></span><span class='list_title'>"+licenseAttaList[i].originName+"</span><span class='gray_info'>上传时间："+licenseAttaList[i].uploadTime+" </span><span class='delete' id="+licenseAttaList[i].oid+" fileType="+licenseAttaList[i].extensionName+"><i class='mui-icon mui-icon-download'></i><font style='font-size: 16px;'>下载</font></span></div>";
						}
						document.getElementById("clList").innerHTML = slide_div_html;
					}
				}
			}, param);
		}
	    
	    
	    //材料样表下载
		mui("body").on('tap', '.license_list .delete', function() { 
			var oid = this.getAttribute('id');
			var fileType = this.getAttribute('fileType');
			var url = utils.HOST + 'appHttpService/appDownLoadNetSelfMaterial.do?oid=' + oid;
			showOrDown(url,oid,null,fileType,function(path){
				openDir(path);
			})
			
		});
	</script>
</html>
